package com.alibaba.ai.controller;

import com.alibaba.ai.service.TrendService;
import com.alibaba.fastjson.JSONObject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

/**
 * 王振东
 */
@Controller
public class TreandController {
    //房价走势
    @Resource
    private TrendService trendService;
    @ResponseBody
    @RequestMapping("/index")
    public String demo() {
        List<JSONObject> list =trendService.getTrend();
        for (JSONObject trend : list) {
            System.out.println(trend);
        }
        return "hello world!";
    }
}
